package com.org.qrtrace.service.impl;

import com.org.qrtrace.pojo.Account;
import com.org.qrtrace.mapper.AccountMapper;
import com.org.qrtrace.service.IAccountService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author bonnie
 * @since 2023-03-18
 */
@Service
public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> implements IAccountService {

    @Autowired
    private AccountMapper mapper;

    @Override
    public Account getById(String uuid) {
        return mapper.getByID(uuid);
    }

    @Override
    public boolean login(Account user) {
        Account account = mapper.login(user.getUser());
        if(account!=null&&account.getPassword().equals(user.getPassword())){
            return true;
        }
        return false;
    }
}
